<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>新闻发布</title>
    <link href="${pageContext.request.contextPath}/static/css/style.css" rel="stylesheet" type="text/css"/>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/js/jquery.js"></script>

    <script type="text/javascript">
        $(document).ready(function () {
            $(".click").click(function () {
                $(".tip").fadeIn(200);
            });
            $(".tiptop a").click(function () {
                $(".tip").fadeOut(200);
            });
            $(".sure").click(function () {
                $(".tip").fadeOut(100);
            });
            $(".cancel").click(function () {
                $(".tip").fadeOut(100);
            });
        });
    </script>
</head>
<body>
<div class="place">
    <span>位置：</span>
    <ul class="placeul">
        <li><a href="#">新闻发布</a></li>
    </ul>
</div>
<div class="rightinfo">
        <div class="tools">
            <ul class="toolbar">
                <li class="addNews"><span><img src="${pageContext.request.contextPath}/static/images/t01.png"/></span>添加</li>
            </ul>
        </div>
    <table class="tablelist">
        <thead>
        <tr>
            <th>序号<i class="sort"><img src="${pageContext.request.contextPath}/static/images/px.gif"/></i></th>
            <th>新闻标题</th>
            <th>创建人</th>
            <th>创建时间</th>
            <th>发布时间</th>
            <th>是否发布</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>

        <c:forEach var="news" items="${newsList}" varStatus="vs">
            <tr>
                <td>${newslist.count}</td>
                <td>${news.title}</td>
                <td>${news.createUserId}</td>
                <td><fmt:formatDate value="${news.createTime}" pattern="y-M-d  HH:mm:ss"/></td>
                <td><fmt:formatDate value="${news.sendTime}" pattern="y-M-d  HH:mm:ss"/></td>
                <td>已审核</td>
                <td><a href="#" class="tablelink">查看</a> <a href="#" class="tablelink"> 删除</a></td>
            </tr>
        </c:forEach>
        </tbody>
    </table>


            <div class="pagin">
                <div class="message">共<i class="blue">${page.total}</i>条记录，当前显示第&nbsp;
                    <i class="blue">${page.pageNum}&nbsp;</i>页
                </div>
                <ul class="paginList">
                    <li class="paginItem"><a class="page_pre" href="/right?page=${page.prePage}:">上页</a></li>
                    <li class="paginItem">
                        <a href="/newsList?page=${page.firstPage}">
                            1</a></li>
                    <li class="paginItem">
                        <a href="/newsList?page=${page.firstPage +1}">
                            2</a></li>
                    <li class="paginItem">
                        <a href="/newsList?page=${page.firstPage +2}">
                            3</a></li>
                    <li class="paginItem">
                        <a href="/newsList?page=${page.firstPage +3}">
                            4</a></li>
                    <li class="paginItem">
                        <a href="/newsList?page=${page.firstPage +4}">
                            5</a></li>
                    <li class="paginItem"><a class="page_nxt" href="/newsList?page=${page.nextPage}">下页</a></li>
                </ul>
            </div>
</div>
<script type="text/javascript">
    $('.tablelist tbody tr:odd').addClass('odd');
    $(function () {
        $('.addNews').click(function () {
            location.href="/form";
        });

    })

</script>
</body>
</html>
